package com.ugoodtech.mdcc.core.model.mapper;

import com.ugoodtech.mdcc.core.model.entity.UserProfiles;
import com.ugoodtech.mdcc.core.model.entity.UserProfilesExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface UserProfilesMapper {
    @SelectProvider(type=UserProfilesSqlProvider.class, method="countByExample")
    int countByExample(UserProfilesExample example);

    @DeleteProvider(type=UserProfilesSqlProvider.class, method="deleteByExample")
    int deleteByExample(UserProfilesExample example);

    @Delete({
        "delete from user_profiles",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
        "insert into user_profiles (id, creation_time, ",
        "deleted, enabled, update_time, ",
        "avatar, company, ",
        "email, gender, level, ",
        "mobilePhone, nickname, ",
        "position, realName, ",
        "serialNumber, telephone, ",
        "add_profile_id, deparment_id, ",
        "parent_sale_id, technology_deparment_id, ",
        "technology_profile_id, user_id, ",
        "is_admin, proince_brand)",
        "values (#{id,jdbcType=BIGINT}, #{creationTime,jdbcType=TIMESTAMP}, ",
        "#{deleted,jdbcType=BIT}, #{enabled,jdbcType=BIT}, #{updateTime,jdbcType=TIMESTAMP}, ",
        "#{avatar,jdbcType=VARCHAR}, #{company,jdbcType=VARCHAR}, ",
        "#{email,jdbcType=VARCHAR}, #{gender,jdbcType=INTEGER}, #{level,jdbcType=VARCHAR}, ",
        "#{mobilephone,jdbcType=VARCHAR}, #{nickname,jdbcType=VARCHAR}, ",
        "#{position,jdbcType=VARCHAR}, #{realname,jdbcType=VARCHAR}, ",
        "#{serialnumber,jdbcType=VARCHAR}, #{telephone,jdbcType=VARCHAR}, ",
        "#{addProfileId,jdbcType=BIGINT}, #{deparmentId,jdbcType=BIGINT}, ",
        "#{parentSaleId,jdbcType=BIGINT}, #{technologyDeparmentId,jdbcType=BIGINT}, ",
        "#{technologyProfileId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, ",
        "#{isAdmin,jdbcType=BIT}, #{proinceBrand,jdbcType=LONGVARCHAR})"
    })
    int insert(UserProfiles record);

    @InsertProvider(type=UserProfilesSqlProvider.class, method="insertSelective")
    int insertSelective(UserProfiles record);

    @SelectProvider(type=UserProfilesSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="creation_time", property="creationTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="deleted", property="deleted", jdbcType=JdbcType.BIT),
        @Result(column="enabled", property="enabled", jdbcType=JdbcType.BIT),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="avatar", property="avatar", jdbcType=JdbcType.VARCHAR),
        @Result(column="company", property="company", jdbcType=JdbcType.VARCHAR),
        @Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
        @Result(column="gender", property="gender", jdbcType=JdbcType.INTEGER),
        @Result(column="level", property="level", jdbcType=JdbcType.VARCHAR),
        @Result(column="mobilePhone", property="mobilephone", jdbcType=JdbcType.VARCHAR),
        @Result(column="nickname", property="nickname", jdbcType=JdbcType.VARCHAR),
        @Result(column="position", property="position", jdbcType=JdbcType.VARCHAR),
        @Result(column="realName", property="realname", jdbcType=JdbcType.VARCHAR),
        @Result(column="serialNumber", property="serialnumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="telephone", property="telephone", jdbcType=JdbcType.VARCHAR),
        @Result(column="add_profile_id", property="addProfileId", jdbcType=JdbcType.BIGINT),
        @Result(column="deparment_id", property="deparmentId", jdbcType=JdbcType.BIGINT),
        @Result(column="parent_sale_id", property="parentSaleId", jdbcType=JdbcType.BIGINT),
        @Result(column="technology_deparment_id", property="technologyDeparmentId", jdbcType=JdbcType.BIGINT),
        @Result(column="technology_profile_id", property="technologyProfileId", jdbcType=JdbcType.BIGINT),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="is_admin", property="isAdmin", jdbcType=JdbcType.BIT),
        @Result(column="proince_brand", property="proinceBrand", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<UserProfiles> selectByExampleWithBLOBs(UserProfilesExample example);

    @SelectProvider(type=UserProfilesSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="creation_time", property="creationTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="deleted", property="deleted", jdbcType=JdbcType.BIT),
        @Result(column="enabled", property="enabled", jdbcType=JdbcType.BIT),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="avatar", property="avatar", jdbcType=JdbcType.VARCHAR),
        @Result(column="company", property="company", jdbcType=JdbcType.VARCHAR),
        @Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
        @Result(column="gender", property="gender", jdbcType=JdbcType.INTEGER),
        @Result(column="level", property="level", jdbcType=JdbcType.VARCHAR),
        @Result(column="mobilePhone", property="mobilephone", jdbcType=JdbcType.VARCHAR),
        @Result(column="nickname", property="nickname", jdbcType=JdbcType.VARCHAR),
        @Result(column="position", property="position", jdbcType=JdbcType.VARCHAR),
        @Result(column="realName", property="realname", jdbcType=JdbcType.VARCHAR),
        @Result(column="serialNumber", property="serialnumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="telephone", property="telephone", jdbcType=JdbcType.VARCHAR),
        @Result(column="add_profile_id", property="addProfileId", jdbcType=JdbcType.BIGINT),
        @Result(column="deparment_id", property="deparmentId", jdbcType=JdbcType.BIGINT),
        @Result(column="parent_sale_id", property="parentSaleId", jdbcType=JdbcType.BIGINT),
        @Result(column="technology_deparment_id", property="technologyDeparmentId", jdbcType=JdbcType.BIGINT),
        @Result(column="technology_profile_id", property="technologyProfileId", jdbcType=JdbcType.BIGINT),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="is_admin", property="isAdmin", jdbcType=JdbcType.BIT)
    })
    List<UserProfiles> selectByExample(UserProfilesExample example);

    @Select({
        "select",
        "id, creation_time, deleted, enabled, update_time, avatar, company, email, gender, ",
        "level, mobilePhone, nickname, position, realName, serialNumber, telephone, add_profile_id, ",
        "deparment_id, parent_sale_id, technology_deparment_id, technology_profile_id, ",
        "user_id, is_admin, proince_brand",
        "from user_profiles",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="creation_time", property="creationTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="deleted", property="deleted", jdbcType=JdbcType.BIT),
        @Result(column="enabled", property="enabled", jdbcType=JdbcType.BIT),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="avatar", property="avatar", jdbcType=JdbcType.VARCHAR),
        @Result(column="company", property="company", jdbcType=JdbcType.VARCHAR),
        @Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
        @Result(column="gender", property="gender", jdbcType=JdbcType.INTEGER),
        @Result(column="level", property="level", jdbcType=JdbcType.VARCHAR),
        @Result(column="mobilePhone", property="mobilephone", jdbcType=JdbcType.VARCHAR),
        @Result(column="nickname", property="nickname", jdbcType=JdbcType.VARCHAR),
        @Result(column="position", property="position", jdbcType=JdbcType.VARCHAR),
        @Result(column="realName", property="realname", jdbcType=JdbcType.VARCHAR),
        @Result(column="serialNumber", property="serialnumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="telephone", property="telephone", jdbcType=JdbcType.VARCHAR),
        @Result(column="add_profile_id", property="addProfileId", jdbcType=JdbcType.BIGINT),
        @Result(column="deparment_id", property="deparmentId", jdbcType=JdbcType.BIGINT),
        @Result(column="parent_sale_id", property="parentSaleId", jdbcType=JdbcType.BIGINT),
        @Result(column="technology_deparment_id", property="technologyDeparmentId", jdbcType=JdbcType.BIGINT),
        @Result(column="technology_profile_id", property="technologyProfileId", jdbcType=JdbcType.BIGINT),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="is_admin", property="isAdmin", jdbcType=JdbcType.BIT),
        @Result(column="proince_brand", property="proinceBrand", jdbcType=JdbcType.LONGVARCHAR)
    })
    UserProfiles selectByPrimaryKey(Long id);

    @UpdateProvider(type=UserProfilesSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") UserProfiles record, @Param("example") UserProfilesExample example);

    @UpdateProvider(type=UserProfilesSqlProvider.class, method="updateByExampleWithBLOBs")
    int updateByExampleWithBLOBs(@Param("record") UserProfiles record, @Param("example") UserProfilesExample example);

    @UpdateProvider(type=UserProfilesSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") UserProfiles record, @Param("example") UserProfilesExample example);

    @UpdateProvider(type=UserProfilesSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(UserProfiles record);

    @Update({
        "update user_profiles",
        "set creation_time = #{creationTime,jdbcType=TIMESTAMP},",
          "deleted = #{deleted,jdbcType=BIT},",
          "enabled = #{enabled,jdbcType=BIT},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "avatar = #{avatar,jdbcType=VARCHAR},",
          "company = #{company,jdbcType=VARCHAR},",
          "email = #{email,jdbcType=VARCHAR},",
          "gender = #{gender,jdbcType=INTEGER},",
          "level = #{level,jdbcType=VARCHAR},",
          "mobilePhone = #{mobilephone,jdbcType=VARCHAR},",
          "nickname = #{nickname,jdbcType=VARCHAR},",
          "position = #{position,jdbcType=VARCHAR},",
          "realName = #{realname,jdbcType=VARCHAR},",
          "serialNumber = #{serialnumber,jdbcType=VARCHAR},",
          "telephone = #{telephone,jdbcType=VARCHAR},",
          "add_profile_id = #{addProfileId,jdbcType=BIGINT},",
          "deparment_id = #{deparmentId,jdbcType=BIGINT},",
          "parent_sale_id = #{parentSaleId,jdbcType=BIGINT},",
          "technology_deparment_id = #{technologyDeparmentId,jdbcType=BIGINT},",
          "technology_profile_id = #{technologyProfileId,jdbcType=BIGINT},",
          "user_id = #{userId,jdbcType=BIGINT},",
          "is_admin = #{isAdmin,jdbcType=BIT},",
          "proince_brand = #{proinceBrand,jdbcType=LONGVARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKeyWithBLOBs(UserProfiles record);

    @Update({
        "update user_profiles",
        "set creation_time = #{creationTime,jdbcType=TIMESTAMP},",
          "deleted = #{deleted,jdbcType=BIT},",
          "enabled = #{enabled,jdbcType=BIT},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "avatar = #{avatar,jdbcType=VARCHAR},",
          "company = #{company,jdbcType=VARCHAR},",
          "email = #{email,jdbcType=VARCHAR},",
          "gender = #{gender,jdbcType=INTEGER},",
          "level = #{level,jdbcType=VARCHAR},",
          "mobilePhone = #{mobilephone,jdbcType=VARCHAR},",
          "nickname = #{nickname,jdbcType=VARCHAR},",
          "position = #{position,jdbcType=VARCHAR},",
          "realName = #{realname,jdbcType=VARCHAR},",
          "serialNumber = #{serialnumber,jdbcType=VARCHAR},",
          "telephone = #{telephone,jdbcType=VARCHAR},",
          "add_profile_id = #{addProfileId,jdbcType=BIGINT},",
          "deparment_id = #{deparmentId,jdbcType=BIGINT},",
          "parent_sale_id = #{parentSaleId,jdbcType=BIGINT},",
          "technology_deparment_id = #{technologyDeparmentId,jdbcType=BIGINT},",
          "technology_profile_id = #{technologyProfileId,jdbcType=BIGINT},",
          "user_id = #{userId,jdbcType=BIGINT},",
          "is_admin = #{isAdmin,jdbcType=BIT}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(UserProfiles record);
}